﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MachineQA.Model;

namespace MachineQA.DataAccess
{
    public interface IMachineRepository
    {
        event EventHandler<MachineAddedOrRemovedEventArgs> MachineAddedOrRemoved;

        /// <summary>
        /// Add a machine to the repository.
        /// </summary>
        /// <param name="machine">The machine to add. Throws ArgumentNullException if machine is null.</param>
        void AddMachine(Machine machine);

        /// <summary>
        /// Removes the specified machine.
        /// </summary>
        /// <param name="machine">The machine to remove.</param>
        void RemoveMachine(Machine machine);

        /// <summary>
        /// Returns the list of machines that are contained in the repository.
        /// </summary>
        /// <returns>A List<Machine> that contains the items in the repository.</returns>
        List<Machine> GetMachines();

        event EventHandler<MachineEnergiesModifiedEventArgs> MachineEnergiesModified;

        /// <summary>
        /// Adds an energy to the specified machine.
        /// </summary>
        /// <param name="machine">The machine to add the energy to.</param>
        /// <param name="energy">The energy to add.</param>
        void AddMachineEnergy(Machine machine, Energy energy);

        /// C:\Users\mike\Documents\Visual Studio 2010\Projects\machineqa\MachineQA\DataAccess\LocationAddedEventArgs.cs<summary>
        /// Removes the specified energy from the specified machine.
        /// </summary>
        /// <param name="machine">The machine to remove the energy from.</param>
        /// <param name="energy">The energy to remove.</param>
        void RemoveMachineEnergy(Machine machine, Energy energy);

        /// <summary>
        /// Determines if the repository contains the specified machine.
        /// </summary>
        /// <param name="machine">The machine to look for.</param>
        /// <returns>Whether or not the machine is contained in the repository.</returns>
        bool ContainsMachine(Machine machine);
    }
}
